package com.sktk.keepAccount.config;

import com.sktk.keepAccount.common.core.vo.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 该类使用场景在：当需要在静态方法中获取配置时，因静态方法无法直接获取配置
 * https://jingyan.baidu.com/article/215817f7c907835fdb142348.html
 */
@Configuration
public class EnvConfig {

    @Value("${spring.profiles.active}")
    private String env;

    @Bean
    public int initStatic() {
        Result.setEnv(env);
        return 0;
    }
}
